Skip to content

Avoid creating a pass for main_transparent_pass_2d when unecessary#24850

Open
PJB3005 wants to merge 1 commit into
bevyengine:mainfrom
PJB3005:26-07-02-transparent-dont-run
Open

Avoid creating a pass for main_transparent_pass_2d when unecessary#24850
PJB3005 wants to merge 1 commit into
bevyengine:mainfrom
PJB3005:26-07-02-transparent-dont-run

Conversation

@PJB3005

@PJB3005 PJB3005 commented Jul 2, 2026

Copy link
Copy Markdown

Objective

  • Less CPU & GPU usage from an empty render pass

Solution

  • Move the if condition to earlier

Testing

  • Ran 2d_shapes and transparency_2d examples and it looks fine.

Showcase

tracy-profiler_iW4FEIsKxw

@mardzie mardzie left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good to me but I am not familiar with the broader context.

@beicause beicause left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

We already skipped empty render pass for 3d

if !transparent_phase.items.is_empty() {

transparent 3d doesn't skip the webgl2 workaround though, but this is fine (#24851).

@PJB3005

PJB3005 commented Jul 3, 2026

Copy link
Copy Markdown
Author

transparent 3d doesn't skip the webgl2 workaround though

Yeah I figured that'd be fine since we're not doing anything here.

@kfc35 kfc35 added A-Rendering Drawing game state to the screen C-Performance A change motivated by improving speed, memory usage or compile times S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels Jul 4, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering Jul 4, 2026
@kfc35 kfc35 added the D-Straightforward Simple bug fixes and API improvements, docs, test and examples label Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Performance A change motivated by improving speed, memory usage or compile times D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

4 participants